import request from "@/axios/axios.ts";
import {
    MaterialGroup,
    MaterialGroupFuzzySearch,
    MaterialGroupUse,
    MaterialUse
} from "@/api/inventory/material_group/type.ts";
enum API1 {
    A = '/inventory/material_group_deactivation_and_activation',
    B = '/inventory/material_deactivation_and_activation',
    C = '/inventory/material_group_crud',
    D = '/inventory/material_group_fuzzy_search'
}


// 出入库和库存表
export const req_material_group_deactivation_and_activation = (data: MaterialGroupUse): Promise<any> => {
    return request.post<any, any>(API1.A, data)
}

export const req_material_deactivation_and_activation = (data: MaterialUse): Promise<any> => {
    return request.post<any, any>(API1.B, data)
}

export const req_material_group_fuzzy_search = (data: MaterialGroupFuzzySearch): Promise<any> => {
    return request.post<any, any>(API1.D, data)
}

export const req_material_group_create = (data: MaterialGroup<'create'>): Promise<any> => {
    return request.post<any, any>(API1.C, data)
}

export const req_material_group_delete = (data: MaterialGroup<'delete'>): Promise<any> => {
    return request.post<any, any>(API1.C, data)
}

export const req_material_group_update = (data: MaterialGroup<'update'>): Promise<any> => {
    return request.post<any, any>(API1.C, data)
}

export const req_material_group_read = (data: MaterialGroup<'read'>): Promise<any> => {
    return request.post<any, any>(API1.C, data)
}